package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.common.result.R;
import com.atguigu.yygh.model.acl.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author mgx
 * @version 1.0
 * @description: 管理员用户
 * @date 2022/8/22 11:25
 */
@RestController
@RequestMapping("/admin/user")
public class UserController {
    // 登录
    @ApiOperation(value = "登录接口")
    @PostMapping("/login")
    public R login(@RequestBody User user) {
        // 需要查询数据库
        return R.ok().data("token", "admin-token");
    }

    @GetMapping("/info")
    public R info(String token) {
        return R.ok().data("roles", "[admin]")
                .data("introduction", "I am a super administrator")
                .data("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("name", "Super Admin");
    }
}
